﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataAccessLogic;
using System.Web.Security;

namespace BusinessLogic
{
    [Serializable]
    public abstract class CodeTable<T> : Table 
    {
        #region Fields
        private string _description;
        #endregion

        #region Methods
        public abstract void Create();
        public abstract void Delete();
        protected abstract List<T> ProtectedGetAll();
        protected abstract T ProtectedGetByID(Guid id);
        public abstract void Update();
        
        public List<T> GetAll()
        {
            return ProtectedGetAll();
        }

        public T GetByID(Guid id)
        {
            return ProtectedGetByID(id);
        }
        #endregion

        #region Properties
	    public string Description 
        { 
            get
            { 
                return _description; 
            }
            set
            {
                _description = value;   
            }
        }

        public abstract string CacheKeyName
        {
            get;
        }
        #endregion
    }
}